package com.example.demo.design.demo19_composite;

/**
 * Created by 蔡超 on 2018/10/4.
 */
public class Client {

    public static void main(String[] args) {
        ConcerteCompany root = new ConcerteCompany("总部");
        FinanceDept financeDept = new FinanceDept("总部-财务部");
        root.add(financeDept);

        ConcerteCompany eastCompany = new ConcerteCompany("华东分公司");
        FinanceDept eastFinanceDept = new FinanceDept("华东分公司-财务部");
        eastCompany.add(eastFinanceDept);
        root.add(eastCompany);

        ConcerteCompany westCompany = new ConcerteCompany("西部分公司");
        FinanceDept westFinanceDept = new FinanceDept("西部分公司-财务部");
        westCompany.add(westFinanceDept);
        root.add(westCompany);

        root.display();
    }
}
